<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script>
        $(function() {
            //$("p:contains('sdf')").css("color", "red");
            // $("body :empty").each(function() {
            //     alert($(this)[0].tagName);
            // })
            //("p:has(.aaa)").css("color", "red");
            $("div:parent").css("color", "red");
        });
    </script>
    <style>

    </style>
</head>

<body>
    <p>电饭锅电饭锅</p>
    <p>sdf</p>
    <div>
        <div></div>问问二
    </div>
    <p>水电费水电费<span></span></p>
    <p>23423
        <span class="aaa">电饭锅电饭锅</span>
    </p>
    <div>sdfsdf </div>
</body>

</html>